package mclight.selectors;
import flash.display.DisplayObjectContainer;
import flash.events.Event;
import mclight.containers.Container;

class VUISlider extends UISlider
{
	public function new(
		?parent:DisplayObjectContainer, ?container:Container, x:Int = 0, y:Int = 0,
		label:String = "", defaultEventHandler:Event->Dynamic = null
	)
	{
		_sliderClass = VSlider;
		super(parent, container, x, y, label, defaultEventHandler);
	}
	
	override function init():Void
	{
		super.init();
		setSize(20, 146);
	}
	
	override function construct()
	{
		super.construct();
		_label.autoSize = true;
	}
	
	// PUBLIC METHODS
	
	public override function draw():Void
	{
		formatValueText();
		_label.text = _labelText;
		_label.draw();
		_label.x = Std.int(width - _label.width) >> 1;
		
		_slider.x = Std.int(width - _slider.width) >> 1;
		_slider.y = _label.height;
		_slider.height = _height - _label.height - _valueLabel.height;
		_slider.draw();
		
		_valueLabel.y = _height - _valueLabel.height;
		super.draw();
	}
	
	override function positionValueLabel():Void
	{
		_valueLabel.x = Std.int(width - _valueLabel.width) >> 1;
	}
	
	// HANDLERS
	
	// PROPERTIES
}
